<?php
/*******************************************************************************/
	#This page is to add/edit user details
	#last Updated : August 25 , 2011
/*******************************************************************************/
error_reporting(0);
include('general_include.php');
include"checklogin.php";
include('/class/payment_class.php');
$u_id	      = $_REQUEST['u_id'];
$action		  = $_REQUEST['action'];
//echo "userID :- ".$u_id;
if($action=="trans")
{
	$user_type = $_POST['user_type'];
	/* Holding Data If Error Starts */
	    if($user_type == 2)
		{
		   $redirect_pg = 'user_manager.php?messg=1';
		}
		if($user_type == 1 || $user_type == 3)
		{
		   $table = TABLEPREFIX."_user_type_user_relation";
		   $fields = array(
					'user_id'           => $u_id,
					'user_type_id'	    => $user_type,
					'date_added'		=> date("Y-m-d H:i:s")
					);
		    $AdminManagerObjAjax->InsertRecords($table,$fields,$where);
		   
		   $redirect_pg = 'member_game.php?u_id='.$u_id;
		}   
		
        echo "<script>window.location.href='$redirect_pg'</script>";		 
		exit; 
}

$SelectCatSql="SELECT * FROM ".TABLEPREFIX."_user WHERE user_id=".$u_id;
$RsCatSql = $AdminManagerObjAjax->GetRecords("Row",$SelectCatSql);
$name = $RsCatSql['name'];

$smarty->assign('name',$name);
$smarty->assign('user_id',$u_id);
$smarty->assign('SubmitButton',$SubmitButton);

/* Assign Smarty Variables Ends */

$smarty->display("user_type.tpl");
?>